package funcs

func DeleteItem(slice []int, index int) []int {
	return append(slice[:index], slice[index+1:]...)
}

func IsInArray(target int, intArray []int) bool {
	for _, element := range intArray {
		if target == element {
			return true
		}
	}
	return false
}

func GetIndices(slice []int, value int) (indices []int) {
	for i, element := range slice {
		if value == element {
			indices = append(indices, i)
		}
	}
	return
}

func DeleteElements(slice []int, value int) (newSlice []int) {
	for _, element := range slice {
		if element == value {
			continue
		}
		newSlice = append(newSlice, element)
	}
	return
}
